﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sdepci.InfoCode.BLL.Authority;

namespace Sdepci.InfoCode.Web
{
    public partial class Index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // 登录状态检测
            if (Session["User"] == null)
            {
                this.Response.Redirect("Login.aspx");
            }
            else
            {
                this.lblUserId.Text = (Session["User"] as User).UserId;
            }
        }

        protected void btnLogout_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "<script language=\"javascript\">self.close();</script>");
        }
    }
}
